<template>
  <div class="home-container">
    <!-- Header Section -->
    <header class="hero-section">
      <div class="hero-content">
        <h1 class="hero-title">AlphaExam 智能考试系统</h1>
        <p class="hero-subtitle">基于AI技术的智能考试平台，让考试更智能、更高效、更公平</p>
        <div class="hero-buttons">
          <el-button type="primary" size="large" @click="goToLogin">立即体验</el-button>
          <el-button type="success" size="large" @click="learnMore">了解更多</el-button>
        </div>
      </div>
      <div class="hero-image">
        <div class="floating-card card-1">
          <div class="icon-placeholder">
            <span>📝</span>
          </div>
          <span>在线考试</span>
        </div>
        <div class="floating-card card-2">
          <div class="icon-placeholder">
            <span>📊</span>
          </div>
          <span>智能分析</span>
        </div>
        <div class="floating-card card-3">
          <div class="icon-placeholder">
            <span>📈</span>
          </div>
          <span>成绩报告</span>
        </div>
      </div>
    </header>

    <!-- Features Section -->
    <section class="features-section">
      <div class="section-title">
        <h2>核心功能</h2>
        <p>为教育机构和学生提供全方位的智能考试解决方案</p>
      </div>
      
      <el-row :gutter="30" class="features-container">
        <el-col :span="8">
          <div class="feature-card">
            <div class="feature-icon">
              <span>✏️</span>
            </div>
            <h3>智能组卷</h3>
            <p>基于AI算法自动组卷，确保试卷难度均衡，知识点覆盖全面</p>
          </div>
        </el-col>
        
        <el-col :span="8">
          <div class="feature-card">
            <div class="feature-icon">
              <span>🖥️</span>
            </div>
            <h3>在线监考</h3>
            <p>多维度监控考试过程，防止作弊行为，确保考试公平性</p>
          </div>
        </el-col>
        
        <el-col :span="8">
          <div class="feature-card">
            <div class="feature-icon">
              <span>🤖</span>
            </div>
            <h3>AI阅卷</h3>
            <p>智能批改主观题和客观题，快速准确生成成绩</p>
          </div>
        </el-col>
      </el-row>
      
      <el-row :gutter="30" class="features-container">
        <el-col :span="8">
          <div class="feature-card">
            <div class="feature-icon">
              <span>📉</span>
            </div>
            <h3>数据分析</h3>
            <p>深度分析考试结果，提供个性化学习建议</p>
          </div>
        </el-col>
        
        <el-col :span="8">
          <div class="feature-card">
            <div class="feature-icon">
              <span>👥</span>
            </div>
            <h3>多角色管理</h3>
            <p>支持管理员、教师、学生三种角色，权限分明</p>
          </div>
        </el-col>
        
        <el-col :span="8">
          <div class="feature-card">
            <div class="feature-icon">
              <span>📚</span>
            </div>
            <h3>题库管理</h3>
            <p>丰富的题型支持，便捷的题目导入和管理功能</p>
          </div>
        </el-col>
      </el-row>
    </section>

    <!-- Stats Section -->
    <section class="stats-section">
      <el-row :gutter="30">
        <el-col :span="6">
          <div class="stat-item">
            <div class="stat-number">10K+</div>
            <div class="stat-label">活跃用户</div>
          </div>
        </el-col>
        <el-col :span="6">
          <div class="stat-item">
            <div class="stat-number">500+</div>
            <div class="stat-label">教育机构</div>
          </div>
        </el-col>
        <el-col :span="6">
          <div class="stat-item">
            <div class="stat-number">100K+</div>
            <div class="stat-label">试题数量</div>
          </div>
        </el-col>
        <el-col :span="6">
          <div class="stat-item">
            <div class="stat-number">99.9%</div>
            <div class="stat-label">系统稳定率</div>
          </div>
        </el-col>
      </el-row>
    </section>

    <!-- CTA Section -->
    <section class="cta-section">
      <div class="cta-content">
        <h2>开启智能考试新时代</h2>
        <p>加入我们，体验AI技术带来的教育变革</p>
        <el-button type="primary" size="large" @click="goToLogin">立即开始</el-button>
      </div>
    </section>

    <!-- Footer -->
    <footer class="home-footer">
      <div class="footer-content">
        <p>© 2025 AlphaExam 智能考试系统. 保留所有权利.</p>
      </div>
    </footer>
  </div>
</template>

<script>
export default {
  name: 'HomeView',
  methods: {
    goToLogin() {
      this.$router.push('/login')
    },
    learnMore() {
      const element = document.querySelector('.features-section')
      element.scrollIntoView({ behavior: 'smooth' })
    }
  }
}
</script>

<style scoped lang="scss">
.home-container {
  width: 100%;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  overflow-x: hidden;
}

.hero-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 100px 50px 50px;
  max-width: 1400px;
  margin: 0 auto;
  
  .hero-content {
    flex: 1;
    padding-right: 50px;
    
    .hero-title {
      font-size: 3.5rem;
      font-weight: 700;
      margin-bottom: 20px;
      line-height: 1.2;
      text-shadow: 0 2px 10px rgba(0,0,0,0.2);
    }
    
    .hero-subtitle {
      font-size: 1.5rem;
      margin-bottom: 40px;
      opacity: 0.9;
      line-height: 1.5;
    }
    
    .hero-buttons {
      .el-button {
        margin-right: 20px;
        padding: 15px 30px;
        font-size: 1.1rem;
        border-radius: 50px;
        border: none;
        
        &:last-child {
          margin-right: 0;
        }
      }
    }
  }
  
  .hero-image {
    flex: 1;
    position: relative;
    height: 400px;
    
    .floating-card {
      position: absolute;
      background: rgba(255, 255, 255, 0.15);
      backdrop-filter: blur(10px);
      border-radius: 20px;
      padding: 25px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      width: 180px;
      height: 180px;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
      border: 1px solid rgba(255, 255, 255, 0.18);
      transition: transform 0.3s ease;
      
      &:hover {
        transform: translateY(-10px);
      }
      
      .icon-placeholder {
        font-size: 3rem;
        margin-bottom: 15px;
      }
      
      span {
        font-size: 1.2rem;
        font-weight: 500;
      }
    }
    
    .card-1 {
      top: 0;
      left: 100px;
    }
    
    .card-2 {
      top: 150px;
      right: 100px;
    }
    
    .card-3 {
      bottom: 0;
      left: 200px;
    }
  }
}

.features-section {
  padding: 100px 50px;
  background: #fff;
  color: #333;
  max-width: 1400px;
  margin: 0 auto;
  
  .section-title {
    text-align: center;
    margin-bottom: 70px;
    
    h2 {
      font-size: 2.5rem;
      margin-bottom: 20px;
      color: #333;
    }
    
    p {
      font-size: 1.2rem;
      color: #666;
      max-width: 600px;
      margin: 0 auto;
    }
  }
  
  .features-container {
    margin-bottom: 30px;
  }
  
  .feature-card {
    text-align: center;
    padding: 40px 20px;
    border-radius: 15px;
    transition: all 0.3s ease;
    height: 100%;
    
    &:hover {
      transform: translateY(-10px);
      box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    }
    
    .feature-icon {
      width: 80px;
      height: 80px;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0 auto 25px;
      
      span {
        font-size: 2.5rem;
        color: white;
      }
    }
    
    h3 {
      font-size: 1.5rem;
      margin-bottom: 15px;
      color: #333;
    }
    
    p {
      font-size: 1rem;
      color: #666;
      line-height: 1.6;
    }
  }
}

.stats-section {
  padding: 80px 50px;
  background: linear-gradient(135deg, #43cea2 0%, #185a9d 100%);
  color: #fff;
  max-width: 1400px;
  margin: 0 auto;
  
  .stat-item {
    text-align: center;
    padding: 30px;
    
    .stat-number {
      font-size: 3rem;
      font-weight: 700;
      margin-bottom: 10px;
    }
    
    .stat-label {
      font-size: 1.2rem;
      opacity: 0.9;
    }
  }
}

.cta-section {
  padding: 100px 50px;
  background: #f8f9fa;
  text-align: center;
  max-width: 1400px;
  margin: 0 auto;
  
  .cta-content {
    max-width: 700px;
    margin: 0 auto;
    
    h2 {
      font-size: 2.5rem;
      margin-bottom: 20px;
      color: #333;
    }
    
    p {
      font-size: 1.2rem;
      color: #666;
      margin-bottom: 40px;
    }
    
    .el-button {
      padding: 15px 40px;
      font-size: 1.1rem;
      border-radius: 50px;
    }
  }
}

.home-footer {
  background: #333;
  padding: 30px 0;
  text-align: center;
  
  .footer-content {
    p {
      margin: 0;
      color: #fff;
      opacity: 0.7;
    }
  }
}

@media (max-width: 992px) {
  .hero-section {
    flex-direction: column;
    text-align: center;
    
    .hero-content {
      padding-right: 0;
      margin-bottom: 50px;
    }
    
    .hero-buttons {
      display: flex;
      justify-content: center;
    }
  }
  
  .hero-image {
    width: 100%;
  }
  
  .features-section {
    .feature-card {
      margin-bottom: 30px;
    }
  }
}
</style>